﻿@model MvcOrganizer.ViewModels.AdminViewModel

@{
    ViewBag.Title = "Index";
}

<h1>Admin Index</h1>
<h2>Reports</h2>
<table>
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.reports.FirstOrDefault().ID)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.reports.FirstOrDefault().ReportType)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.reports.FirstOrDefault().State)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.reports.FirstOrDefault().Message)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.reports.FirstOrDefault().CreatedDate)
        </th>
        <th>Actions
        </th>
    </tr>
    @foreach (var item in Model.reports)
    {
        <tr>
            <td>@Html.DisplayFor(modelItem => item.ID)
            </td>
            <td>@Html.DisplayFor(modelItem => item.ReportType)
            </td>
            <td>@Html.DisplayFor(modelItem => item.State)
            </td>
            <td>@Html.DisplayFor(modelItem => item.Message)
            </td>
            <td>@Html.DisplayFor(modelItem => item.CreatedDate)
            </td>
            <td>
                @Html.ActionLink("Edit", "EditReport", new { id = item.ID }) |         
            @Html.ActionLink("Delete", "DeleteReport", new { id = item.ID })
            </td>
        </tr>
    }
</table>
<h2>User Profiles</h2>
<table>
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.users.FirstOrDefault().UserId)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.users.FirstOrDefault().UserName)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.users.FirstOrDefault().Email)
        </th>
        <th>Actions
        </th>
    </tr>
    @foreach (var item in Model.users)
    {
        <tr>
            <td>@Html.DisplayFor(modelItem => item.UserId)
            </td>
            <td>@Html.DisplayFor(modelItem => item.UserName)
            </td>
            <td>@Html.DisplayFor(modelItem => item.Email)
            </td>
            <td>
                @Html.ActionLink("Edit", "EditUser", new { id = item.UserId }) |         
            @Html.ActionLink("Delete", "DeleteUser", new { id = item.UserId })
            </td>
        </tr>
    }
</table>
